﻿#include "concretestateb.h"

#include <QtGlobal>
#include <QDebug>

#include "context.h"
#include "concretestatea.h"

State* ConcreteStateB::m_pSelf = Q_NULLPTR;

ConcreteStateB::ConcreteStateB()
{

}

State *ConcreteStateB::getInstance()
{
    if (m_pSelf == Q_NULLPTR)
        m_pSelf = new ConcreteStateB();
    return m_pSelf;
}

void ConcreteStateB::handle(Context* context)
{
    qDebug() << "handle in ConcreteStateB";
    context->changeState(ConcreteStateA::getInstance());
}
